﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebSoftSeo.Models;

namespace WebSoftSeo.Controllers
{
    public class AboutController : Controller
    {
        WebSoftSeoEntities db = new WebSoftSeoEntities();
        //
        // GET: /About/

        public ActionResult Index()
        {
            About about = db.Abouts.FirstOrDefault();
            return View(about);
        }
        public ActionResult _AboutCategories()
        {
            var aboutcategories = db.AboutCategories.ToList();
            return PartialView(aboutcategories);
        }
        public ActionResult Detail(int id=0)
        {
            About about = db.Abouts.FirstOrDefault();
            AboutCategory aboutcategory = db.AboutCategories.Find(id);
            var lstabout = db.AboutCategories.Where(m => m.AboutID != id).ToList();
            ViewBag.lstabout = lstabout;
            ViewBag.about = about;
            return View(aboutcategory);
        }

    }
}
